#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	int n;
	cin >> n;
	while (cin >> n) {
		if (n < 2)
			cout << "No\n";
		else {
			bool flag = 0;
			for (int i = 2; i <= sqrt(n); i++)
				if (n % i == 0) {
					flag = 1;
					break;
				}
			cout << (flag ? "No\n" : "Yes\n");
		}
	}
	return 0;
}
